<div id="type_list">
<select name="config_name[]" class="form-control type_log">
                
                <option value="">/</option>
                
                {foreach name='type_list' id='type_item'}
                    <option value="{$type_item.name}" data-id="{$type_item.id}" {if isset($item.name) && $item.name==$type_item.name}selected{/if}>
                        {$type_item.name}
                    </option>
                {/foreach}
            </select>
</div>

<script type="text/javascript">

    $(".type_log").change(function(e){
    var selectedIndex = $(this)[0].options.selectedIndex;
    

    var type_id = e.currentTarget[selectedIndex].dataset.id;
    
    type_log(type_id,$(this));
    })
    function type_log(type_id,e){
        
        $.ajax({
            url: "{:url('project/type_log')}",
            method:'get',
            data: {"type_id":type_id},
            success: function (result) {
                e.parent().parent().parent().parent().find('.today_price').val(result.price)
            }
        })
    }
</script>
